<% if @auth and @auth.eql?(@config['auth']) %>
<h1>New gallery</h1>


<% form_for(:gallery, :url => 'create') do |f| %>

<% error_messages_for :gallery %>

<table>
	<input type="hidden" name="auth" value="<%= @config['auth'] %>"/>
	
	<tr>
		<td>Name: </td>
		<td><%= f.text_field 'name' %></td>
	</tr>
	
	<tr>
		<td>Desc: </td>
		<td><%= f.text_field 'desc' %></td>
	</tr>
	
	<tr>
		<td>Site: </td>
		<td><%= select ("gallery", "site_id", @sites.map {|c| [c.name,c.id]}) %></td>
	</tr>
	
	<tr>
		<td>Category: </td>
		<td><%= select ("gallery", "cat_id", @categories.map {|c| [c.name,c.id]}) %></td>
	</tr>
	
	<% if false %>

	<tr>
		<td>Image Dir: </td>
		<td><%= f.text_field 'imagedir' %></td>
	</tr>
	
	<% end %>
	
	<tr>
		<td>Remote Zip: </td>
		<td><input type="text" name="zip"/></td>
	</tr>
	
	<% if false %>
	<tr>
		<td>Thumb File: </td>
		<td><%= f.text_field 'thumbfile' %></td>
	</tr>
	
	<tr>
		<td>Thumb Index: </td>
		<td><%= f.text_field 'thumbindex' %></td>
		<td><%= error_message_on :gallery, :thumbindex %></td>
	</tr>
	<% end %>
	
	<tr>
		<td>Added: </td>
		<td><input type="text" name="added"/></td>
	</tr>

</table>
  <p>
    <input type="submit" value="Create">
  </p>
<% end %>

<% else %>

<h1>Access Denied</h1>

<% end %>